package com.moyq5.spring.boot.app.register.server;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.moyq5.spring.boot.app.register.AppInfo;
import com.moyq5.spring.boot.app.register.AppListener;

/**
 * 任务监听，服务端实现
 * @author Moyq5
 * @date 2019年3月7日
 */
@Component("appInfoServerListener")
public class AppInfoListener implements AppListener {

	@Autowired
	private AppInfoExecutor executor;
	
	@Override
	public void update(AppInfo info) {
		if (executor.update(info)) {
			executor.checkAndNotice(info.getGroupId());
		}
	}

}
